package com.zhentao.controller;

import com.zhentao.model.common.app.dto.UserDataDto;
import com.zhentao.model.common.app.pojo.AppUserData;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.AppUserDataService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/userData")
public class AppUserDataController {
    @Resource
    AppUserDataService appUserDataService;

    /**
     * 根据传入id查询个人信息
     * @param userDataId
     * @return
     */
    @GetMapping("/appById/{userDataId}")
    @ApiOperation("根据id查询个人信息")
    public ResponseResult selectById(@PathVariable("userDataId") Integer userDataId){
        return appUserDataService.selectById(userDataId);
    }

    /**
     * 更新个人信息
     * @param userDataDto
     * @return
     */
    @PostMapping("/appUpdate")
    @ApiOperation("更新个人信息")
    public ResponseResult appUpdate(@RequestBody AppUserData appUserData){
        return appUserDataService.appUpdate(appUserData);
    }


}
